package com.prs.crm.action.project;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.context.AppContext;
import com.prs.crm.domain.project.Task;
import com.prs.crm.service.project.TaskService;

/**
 * 我参与的任务
 * @author courser.tijichen
 *
 */
public class TaskJoinAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	
	private TaskService taskService;
	
	private PaginationSupport pagination;
	
	private Task task;
	
	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public TaskService getTaskService() {
		return taskService;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public Task getTask() {
		return task;
	}
	
	
	@Action("listJoinTask")
	public String listJoinTask()
	{
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(Task.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getTaskService().listJoinTask(criteria, pagination,
				AppContext.getAccountContext().currentUser()));
		return SUCCESS;
	}

	@Action("joinTask")
	public String joinTask()
	{
		return SUCCESS;
	}
	
	@Action("joinTaskTree")
	public String joinTaskTree()
	{
		return SUCCESS;
	}

	@Action("viewJoinTask")
	public String viewJoinTask()
	{
		return SUCCESS;
	}


}
